# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
""" 打印出杨辉三角形（要求打印出10行如下图）。 """

def pas_triangles():
    a = [1]
    while True:
        yield a
        a = [sum(i) for i in zip([0] + a, a + [0])]
 
if __name__ == "__main__":
    g = pas_triangles()
    for n in range(10):
        print(next(g))